#pragma once

#include <ws2tcpip.h>
//#include <aclapi.h>
//#include "Thread.h"



#define CONNECTION_API __declspec(dllexport)



class CONNECTION_API CConnection
{
private:
	WSADATA		wsaData;
	WSADATA		*m_wsaData;
	SOCKADDR_IN *m_sock;
	int nModel;
	int nType;
	int nProtocol;
	//CThread *pThread;

protected:
	int init(char *);
	SOCKET		*m_socket;

public:
	/*
	AF_UNSPEC
	AF_INET
	AF_IPX
	AF_APPLETALK
	AF_NETBIOS
	AF_INET6
	AF_IRDA
	AF_BTH
	---------------
	SOCK_STREAM
	SOCK_DGRAM
	SOCK_RAW
	SOCK_RDM
	SOCK_SEQPACKET
	-----------------------------
	IPPROTO_ICMP
	IPPROTO_IGMP
	BTHPROTO_RFCOMM
	IPPROTO_TCP
	IPPROTO_UDP
	IPPROTO_ICMPV6
	IPPROTO_RM
	*/
	CConnection(int, int, int);
	~CConnection();
	virtual void listen(char *, int nPort);
	SOCKET accept_conn();
	void closeConnection();
};

